<?php
class Qp_Core
{
	
	private static $_path;
	/**
     * simple autoload function
     * returns true if the class was loaded, otherwise false
     *
     * @param string $className
     * @return boolean
     */
	public static function autoload($className)
	{
		if(stripos($className, 'Qp_') !== 0 || class_exists($className, false) || interface_exists($className, false))
		{
			return;
		}
		
		$class = self::getPath() . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR,str_replace('Qp_', '', $className)) . '.php';
		
		if (file_exists($class)) {
            require $class;

            return true;
        }

        return false;
	}
    public static function getPath()
    {
        if ( ! self::$_path) {
            self::$_path = realpath(dirname(__FILE__));
        }

        return self::$_path;
    }
}